home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games Extra 1996 June / Amiga Games Extra 1996 #6.iso / rexx / loadiffmaster.dopus < prev    next >
Text File  |  1996-03-23  |  2KB  |  99 lines

  1. /*
  2. **  $VER: IFFMaster.dopus 0.001 (12 Feb 1996)  **
  3. **
  4. **        © 1996 Andreas Mixich
  5. **
  6. **  PROGRAMNAME:
  7. **      IFFMaster.dopus
  8. **
  9. **  FUNCTION:
  10. **      Loads selected IFF file into IFFMaster 1.5
  11. **      You can still do this without this script, but not if there is already
  12. **      an IFFMaster running.
  13. **
  14. **  $HISTORY:
  15. **
  16. **   12 Feb 1996 : 0.01 : initial release
  17. */
  18.  
  19. /* enable support functions */
  20.  
  21. OPTIONS RESULTS
  22. SIGNAL ON ERROR
  23. SIGNAL ON FAILURE
  24. SIGNAL ON HALT
  25. SIGNAL ON BREAK_C
  26. SIGNAL ON SYNTAX
  27.  
  28. /* define some usefull vars */
  29. LF         = '0A'x                  /* linefeed */
  30. scriptname = 'IFFMaster.dopus'      /* insert scriptname. will be needed later */
  31. iffport    = 'IFFMASTER.1'          /* Name of port for IFFMaster */
  32. dopusport  = 'DOPUS.1'              /* name of Dopus port */
  33. iffmastercommand = 'GFX:Tools/IFFMaster'    /* set to where you keep IFFMaster */
  34.  
  35. /* address DOPUS  */
  36. ADDRESS Value dopusport
  37.  
  38. /* usefull actions. get the listers */
  39. 'STATUS 3'         /* active window */
  40. win = RESULT
  41.  
  42. 'STATUS 13' win    /* pathname of active window */
  43. path = RESULT
  44.  
  45. 'GETNEXTSELECTED' win       /* getnextselected entry */
  46. file = RESULT
  47.  
  48. ADDRESS Value iffport
  49.  
  50. IF ~SHOW('Ports',iffport) THEN
  51.     DO
  52.     ADDRESS COMMAND 'Run >NIL: '||iffmastercommand
  53.     ADDRESS COMMAND 'WaitForPort '||iffport
  54.     IF ~SHOW('Ports',iffport) THEN
  55.         EXIT 10
  56. END
  57.  
  58. 'LOAD '||path||file         /* load file into IFFMaster */
  59.  
  60. ADDRESS DOPUS.1             /* get back to dopus */
  61.  
  62. SELECTFILE file 0 1         /* deselect file */
  63.  
  64. EXIT(0)
  65.  
  66. /* universal requester function */
  67. DREQUEST:
  68. PARSE VAR ErrText, RtValue
  69.  
  70. ADDRESS DOPUS.1
  71. REQUEST scriptname||'0a'x||ErrText||'0a'x||RtValue
  72.  
  73.  
  74. RETURN RtValue
  75.  
  76. /* what to do on BREAK_C or on HALT */
  77. BREAK_C:
  78. HALT:
  79.   Err1 = 'Script interrupted'
  80.   Err2 = 'Execution Ceased at line - 'SIGL
  81.   Err3 = 'Source Line: 'SourceLine(SIGL)
  82.   ErrText = Err1'*n'Err2'*n'Err3
  83.   CALL DRequest(ErrText,RtValue)
  84.   EXIT 10
  85. RETURN
  86.  
  87.  
  88. /* routine for an error */
  89. ERROR:
  90. SYNTAX:
  91. FAILURE:
  92.   Err1 = 'Trapped Error: 'ErrorText(rc)
  93.   Err2 = 'Line 'SIGL':'SourceLine(SIGL)
  94.   ErrText = Err1'*n'Err2
  95.   CALL DRequest(ErrText,RtValue)
  96.   EXIT 20
  97. RETURN
  98.  
  99.